package com.orion.enumeration;


import com.orion.entity.Result;

public enum TokenCodeEnum {
    /**
     * Token过期
     */
    TOKEN_EXPIRED(7000, "Token is expired"),

    /**
     * Token无效
     */
    TOKEN_INVALID(7001, "Token is invalid"),

    /**
     * Token不存在
     */
    TOKEN_NOT_EXIST( 7002, "Token does not exist");

    private Integer code;

    private String msg;

    TokenCodeEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public Result toResult(){
        return  new Result( getMsg(),getCode());
    }
}
